from rest_framework import serializers
from django.contrib.auth.models import Permission

class PermissionSerializer(serializers.ModelSerializer):
    """权限序列化器"""
    class Meta:
        model = Permission
        fields = "__all__"

#####################ContentType#################################
from django.contrib.auth.models import ContentType

class ContentTypeModelSerializer(serializers.ModelSerializer):

    class Meta:
        model=ContentType
        fields=['id','name']

#####################组#################################
from django.contrib.auth.models import Group

class GroupModelSerializer(serializers.ModelSerializer):

    class Meta:
        model=Group
        fields='__all__'